import {getMissionInformation, getMissionDetailedMessage} from "@/api/task";

const state = {
  taskInfo:{},
  taskAllInfo:{},
}

const mutations = {
  setTaskInfo(state,data){
    state.taskInfo = data
  },
  setAllInfo(state,data){
    state.taskAllInfo = data
  }
}

const actions = {
  async getInfo(context,data){
    const result = await getMissionInformation(data)
    context.commit('setTaskInfo',result.data.data)
  },
  async getAllInfo(context,data){
    const result = await getMissionDetailedMessage(data)
    context.commit('setAllInfo',result.data.data)
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

